package database.live;

public class DOAStatements {

	//User DAO Statements.
	//Building up a user profile.
	public static String SELECT_USER_INFORMATION = "select name, avatar, iduser from trackvoodoo.user where loginName=?";
	public static String SELECT_CAR_INFORMATION = "select make, model, description, idCar from trackvoodoo.car where userRef = ?";
	public static String SELECT_CAR_PICTURES = "select pictureLocation, pictureDescription, carRef from trackvoodoo.carpictures where userRef = ? and carRef = ?";
	public static String SELECT_CAR_COMMENTS = "select poster, comment, date from trackvoodoo.carcomments where carRef = ?";
	public static String SELECT_CAR_MODS = "select name, description, cost from trackvoodoo.carmodifications where carRef = ?";
	
	public static String SELECT_TRACK_DATES = "select trackRef, date, userRef, complete, carRef from trackvoodoo.usertrackdays where userRef = ?";
	public static String SELECT_TRACK_DATES_CAR = "select make, model from trackvoodoo.car where idCar = ?";
	public static String SELECT_TRACK_DATES_TRACK = "select trackRef, description from trackvoodoo.trackdays where idtrackDays = ?";
	public static String SELECT_TRACK_DATES_TRACKDETAILS = "select name from trackvoodoo.track where idtrack = ?";
	
	//Adding a new user.
	public static String ADD_NEW_USER = "INSERT INTO trackvoodoo.user (name, loginName, password, joinDate, avatar, adminUser) VALUES (?, ?, ?, CURDATE(), ?, ?)";
	public static String DELETE_USER = "DELETE FROM trackvoodoo.user where name = ?";
	
	
	// Genral track chanings to tables.
	public static String ADD_TRACK = "INSERT INTO trackvoodoo.track (name, description) VALUES (?, ?)";
	public static String DELETE_TRACK = "DELETE FROM trackvoodoo.track where idtrack = ?";
	public static String ADD_TRACKDATE = "INSERT INTO trackvoodoo.trackdays (trackRef, date, decription) VALUES (?,?,?)";
	public static String DELETE_TRACKDATE = "DELETE FROM trackvoodoo.trackdays where idtrackDays = ?";
	public static String SELECT_TRACKDATES = "SELECT idtrackDays, trackRef, date, description from trackvoodoo.trackdays";
	public static String ADD_TRACK_PICTURES = "INSERT INTO trackvoodoo.trackpictures (trackRef, trackOverview, location, picture) VALUES (?, ? ,? ,?)";
	public static String DELETE_TRACK_PICTURES = "DELETE FROM trackvoodoo.trackpictures where idpictures = ?";
	public static String SELECT_TRACK_PICTURES = "select idpictures, trackRef, trackOverview, location, picture from trackvoodoo.trackpictures";
	public static String ADD_USERTRACKDATE = "INSERT INTO trackvoodoo.usertrackdays (trackRef, date, userRef, complete, carRef) VALUES (?,?,?,?,?)";
	public static String DELETE_USERTRACKDATE = "DELETE FROM trackvoodoo.usertrackdays where idusertrackdays = ?";
	public static String SELECT_USERTRACKDATES = "SELECT idusertrackdays, trackRef, date, userRef, compelete, carRef from trackvoodoo.usertrackdays";
	
	//Achivements.
	public static String ADD_ACHIVEMENT = "INSERT INTO trackvoodoo.achivement (internalName, description, instant, count, points, notJpg, gotJpg) values (?,?,?,?,?,?,?) ";
	public static String DELETE_ACHIVEMENT = "DELETE from trackvoodoo.achivement where idachivement = ?";
	public static String SELECT_ACHIVEMENTS = "SELECT idachivement, internalName, description, instant, count, points, notJpg, gotJpg from trackvoodoo.achivement";
	
	//User Points
	
	//Friends section
	public static String SELECT_FRIENDS = "SELECT friendId from trackvoodoo.friends where userId = ?";
	public static String ADD_FRIENDS = "INSERT into trackvoodoo.friends (userId,friendId) VALUES (?,?)";
	public static String REMOVE_FRIENDS = "DELETE from trackvoodoo.friends where userid = ?";
	public static String COUNT_FRIENDS = "select  count(trackRef)  from trackvoodoo.trackdays where trackRef = 1";
	public static String SELECT_USER_BY_FRIEND_ID ="SELECT iduser, name, joinDate, avatar from trackvoodoo.user where userid = ?;";
	public static String SELECT_ALL_USERS = "SELECT iduser, name, joinDate, avatar from trackvoodoo.user";
	public static String ADD_NEW_FRIEND = "INSERT INTO trackvoodoo.friends (userId, friendId) VALUES (?,?)";
	
	//News Section
	public static String SELECT_NEWS = "SELECT idnewsItem, dateCreated, header, story, picture from trackvoodoo.newsitem order by dateCreated DESC LIMIT ?,?";
	
	//Track DOA Statements for buildig up.
	public static String SELECT_TRACKS = "SELECT idtrack, name, description from trackvoodoo.track";
	public static String SELECT_TRACKS_TRACKPICS = "SELECT trackOverview, location, picture from trackvoodoo.trackpictures where trackRef = ?";
	public static String SELECT_TRACKS_TRACKDAYS = "SELECT date, description from trackvoodoo.trackdays where trackRef = ?";
	public static String SELECT_USERPOINTS = "select achivementId, complete, currentPoints, dateComplete from trackvoodoo.userpoints where userRef = ?";
	public static String SELECT_USERPOINTSDETAILS = "select description, notJpg, gotJpg from trackvoodoo.achivement where idachivement = ?";
	
	
	
	
}
